package com.feihao.zhou.demo02_Map;

import java.util.HashMap;
import java.util.Map;

public class Demo01MapTest {
    public static void main(String[] args) {
        Map<String,String> map = new HashMap<>();
        map.put("001","小三");
        map.put("004","仅仅");
        map.put("002","方法");
        map.put("003","更改");
        map.put("006","仅仅");
        map.put("0022","仅仅");
        System.out.println("更改前：" + map);


        map.put("003","平安喜乐");

        System.out.println("更改后：" + map);

//        Set<String> set = map.keySet();
//        for (String s : set) {
//            System.out.println(s+"="+map.get(s));
//        }
//
//        map.put("0202002","笑话");
//        System.out.println(map);
//
//        String value = map.remove("0022");
//        System.out.println(value);
//        System.out.println(map);

        /*map.clear();
        System.out.println(map);

        System.out.println(map.isEmpty());*/


        System.out.println(map.containsKey("0022"));
        System.out.println(map.containsKey("22222"));

        System.out.println(map.size());//6
    }
}
